package com.example.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.example.login.LoginService;


public class ServiceManager implements IServiceManager {
	

	private static ServiceManager _instance = null;
	private static Map<String, IService> servicesList = new ConcurrentHashMap<String, IService>();
	
	private ServiceManager(){
		
	}
	
	public static ServiceManager getInstance(){
		if(_instance == null)
			_instance = new ServiceManager();
		return _instance;
	}

	public void init(){
		IService loginService = LoginService.getInstance();
		loginService.init();
		
		servicesList.put(IService.LOGINSERVICE, loginService);
	}

	public IService getService(String serviceName) {
		return servicesList.get(serviceName);
	}
}
